/**
 * Created by apple on 16/6/26.
 */
angular.module("starter.config", ['ionic', 'ionic-datepicker','ionic-native-transitions'])
  .constant("ENV", {
    // "name": "production",
    "accessToken": '',
    "debug": true,
    "api": "http://210.73.192.83/",
    // "api": "http://pm.ht-home.cn/",
    // "api": "http://192.168.2.99:8093/v1/",
    // "api": "http://localhost:3000/api/v1",
    //"api":'http://10.0.100.154:8083/v1/',
    "appleId": 'id981408438',
    'version': '1.0.1'
  })
  .constant("$ionicLoadingConfig", {})

  .constant("IMAGES",{
    "survey":["ROOF_SIZE","JHJTT_KC","FWZST","ROOF_PANORAMA","AROUND_ROOF","ROOF_EAST","ROOF_SOUTH","ROOF_WEST","TILE_PHOTO","XWJGZP","LJGZP","YZTGZLT","NBQAZWZ","PDXAZWZ","BWDWZ"],

    "progressReport":["GGLJC_JD","FSCL_JD","DGAZ_JD","ZJAZ_JD","NBQAZ_JD","PDXAZ_JD"]
  })

  .constant("ROLES",{
    "spmsAdmin":"SPMS_ADMIN",
    "spmsDistributorAdmin":"SPMS_DISTRIBUTOR_ADMIN",
    "spmsDistributorSm":"SPMS_DISTRIBUTOR_SM",
    "spmsDistributorTech":"SPMS_DISTRIBUTOR_TECH",
    "spmsHtJszlAdmin":"SPMS_HT_JSZL_ADMIN",
    "spmsHtScAdmin":"SPMS_HT_SC_ADMIN",
    "spmsHtXsAdmin":"SPMS_HT_XS_ADMIN",
    "spmsInstallerAdmin":"SPMS_INSTALLER_ADMIN",
    "spmsInstallerPm":"SPMS_INSTALLER_PM",
    "spmsApproversAdmin":"SPMS_APPROVERS_ADMIN",
    "spmsApproversEc":"SPMS_APPROVERS_EC",
    "spmsApproversHt":"SPMS_APPROVERS_HT",
    "spmsApproversOver":"SPMS_APPROVERS_OVER",
    "spmsDistributorCgy":"SPMS_DISTRIBUTOR_CGY"
  })

  .config(['$compileProvider',function( $compileProvider ) {
    $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|file|blob|cdvfile):|data:image\//);
  }])
  .config(function (ionicDatePickerProvider) {
    var currentDate = new Date();
    var datePickerObj = {
      inputDate: currentDate,
      setLabel: '确认',
      todayLabel: '今天',
      closeLabel: '关闭',
      mondayFirst: false,
      weeksList: ["日", "一", "二", "三", "四", "五", "六"],
      monthsList: ["Jan", "Feb", "March", "April", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"],
      templateType: 'popup',
      from: new Date(new Date().setMonth(currentDate.getMonth()-2)),
      to: new Date(new Date().setFullYear(currentDate.getFullYear()+1)),
      showTodayButton: false,
      dateFormat: 'dd MMMM yyyy',
      closeOnSelect: true,
      disableWeekdays: []
    }
    ionicDatePickerProvider.configDatePicker(datePickerObj);
  })


  //.config(function($ionicNativeTransitionsProvider) {
  //  $ionicNativeTransitionsProvider.enable(true);
  //  $ionicNativeTransitionsProvider.setDefaultOptions({
  //    duration: 400, // in milliseconds (ms), default 400,
  //    slowdownfactor: 4, // overlap views (higher number is more) or no overlap (1), default
  //    iosdelay: -1, // ms to wait for the iOS webview to update before animation kicks in,default -1
  //    androiddelay: -1, // same as above but for Android, default -1
  //    fixedPixelsTop: 0, // the number of pixels of your fixed header, default 0 (iOS and Android)
  //    fixedPixelsBottom: 0, // the number of pixels of your fixed footer (f.i. a tab bar), default 0 (iOS and Android)
  //    triggerTransitionEvent: '$ionicView.enter', // internal ionic-native-transitions option
  //    backInOppositeDirection: false // Takes over default back transition and state back transition to use the opposite direction transition to go back
  //  });
  //})

  //.config(function($ionicNativeTransitionsProvider){ $ionicNativeTransitionsProvider.setDefaultTransition({
  //  //"type"          : "fade",
  //  //"direction"     : "left", // 'left|right|up|down', default 'left' (which is like 'next')
  //  });
  //})
  //
  //.config(function($ionicNativeTransitionsProvider){ $ionicNativeTransitionsProvider.setDefaultBackTransition({
  //  //"type"          : "fade",
  //  //"direction"     : "right", // 'left|right|up|down', default 'left' (which is like 'next')
  //  });
  //})


